[LINQ] Nested query problem
        Posted  
        
            by code-zoop
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by code-zoop
        
        
        
        Published on 2010-05-10T11:48:04Z
        Indexed on 
            2010/05/10
            11:54 UTC
        
        
        Read the original article
        Hit count: 311
        
LINQ
I have 3 classes in C#:
classclass Folder
{
    int Id { get; set; }
    List<File> files { get; set;}
}
class File
{
    int Id { get; set; }
    Author author { get; set; }
}
class Author
{
    int Id { get; set; }
    string Name { get; set; }
} 
I have a list of Folder items (List):
var folders = getAllFolders();
How can I use Linq to return a list of Folders from the list when i only know the Author id of the files?
I need the list to contain all folders where a given Author has created a file!
Thanks
© Stack Overflow or respective owner